Extracting pixel blocks from image data is known, each block representing a portion of the image data, and to apply prescribed image processing to the image data on a pixel-block by pixel-block basis. FIG. 1 is a diagram for explaining image processing to be applied to image data 100 in raster format. The image data 100 is made up of pixels arranged in the main direction and sub direction, and contains a plurality of pixel data elements, one for each pixel, to represent an image as an array of pixels.
The direction along which the pixels corresponding to the contiguous pixel data elements contained in the image data in raster format are arranged is designated as the “main direction,” and the direction orthogonal to the main direction as the “sub direction”. A pixel block 101 is one of the pixel blocks extracted from the image data 100, each block representing a portion of the image data, and image processing is applied to each such pixel block 101.
In the related art, it is known to provide a method for rotating an image. According to this method, an image is stored in raster format as a sequence of a plurality of bytes each having n bits, and a plurality of bytes are written into a temporary storage and separated into groups of rotatable size. The method then determines for each group whether all bits are of the same value, rotates each group in which all bits are not of the same value, and writes each rotated group in raster format into an output image storage area (for example, refer to Japanese Laid-open Patent Publication No. 60-146367).